/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author orgale
 */
@Embeddable
public class MaterialSupplierPK implements Serializable {
    
    private int idMaterial;
    private int idSupplier;

    public MaterialSupplierPK() {
    }

    public MaterialSupplierPK(int idMaterial, int idSupplier) {
        this.idMaterial = idMaterial;
        this.idSupplier = idSupplier;
    }

    @Basic(optional = false)
    @Column(name = "id_material")
    public int getIdMaterial() {
        return idMaterial;
    }

    public void setIdMaterial(int idMaterial) {
        this.idMaterial = idMaterial;
    }

    @Basic(optional = false)
    @Column(name = "id_person")
    public int getIdSupplier() {
        return idSupplier;
    }

    public void setIdSupplier(int idSupplier) {
        this.idSupplier = idSupplier;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idMaterial;
        hash += (int) idSupplier;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MaterialSupplierPK)) {
            return false;
        }
        MaterialSupplierPK other = (MaterialSupplierPK) object;
        if (this.idMaterial != other.idMaterial) {
            return false;
        }
        if (this.idSupplier != other.idSupplier) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.click.app.model.MaterialSupplierPK[idMaterial=" + idMaterial + ", idSupplier=" + idSupplier + "]";
    }

}
